import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.select import Select
x="网站很好看"
testCase = "DBshop015商品管理管理分类前台侧边设置"

firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,'商品管理','管理分类','前台侧边设置')

firefox.find_element_by_partial_link_text('添加侧边显示').click()
firefox.find_element_by_id("frontside_name").send_keys(x)
firefox.find_element_by_xpath("/html/body/div[2]/div/div[2]/div/form/div/div[1]/div[2]/button/i").click()


# 断言
time.sleep(4)
#断言  get_property("value") 根据元素的属性名获取属性值
shijizhi=firefox.find_element_by_xpath\
    ('/html/body/div[2]/div/div[2]/form/table/tbody/tr[1]/td[2]/input').get_attribute("value")
if shijizhi=="255": #如果预期值跟实际值相等
    writeLog("%s 测试通过" % testCase)
else:
    writeLog("%s 测试不通过" % testCase)
    getPhoto(firefox)
firefox.quit()